/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Queue;

/**
 *
 * @author Administrator
 */
public class QNode
{
    private Object data;	//data field on QNode
	private QNode next;		//link to next QNode
	/**
	 * constructor to initialize new empty QNode
	 */
	public QNode()
	{
		data = null;
		next = null;
	}
	/**
	 * constructor to initialize new QNode with data
	 * @param o data field
	 * @param link link to next QNode
	 */
	public QNode(Object o, QNode link)
	{
		// TODO Auto-generated constructor stub
		data = o;
		next = link;
	}
	/**
	 * get data field of given QNode
	 * @return	data field of this QNode
	 */
	public Object getData()
	{
		return data;
	}
	/**
	 *  set data field of given QNode
	 * @param data new data
	 */
	public void setData(Object data)
	{
		this.data = data;
	}
	/**
	 *  get next QNode of given QNode
	 * @return next QNode
	 */
	public QNode getNext()
	{
		return next;
	}
	/**
	 *  set next link of given QNode
	 * @param next new next link
	 */
	public void setNext(QNode next)
	{
		this.next = next;
	}

}
